// import fetchSource from '../../dist/fetch-source'
const fetchSource = require('../../dist/fetch-source');

const btn = document.getElementById('get');
btn.addEventListener('click', function () {
    const videoId = '123';
    const server = 'ws://localhost:5000';
    const fs = new fetchSource(server, videoId);

    const resourceUrl = '/abc.ts';
    const timeout = 1500;

    fs.fetch(resourceUrl, timeout).then(buf => {
        console.log(typeof buf); //[ArrayBuffer] 
    });
});